package com.atguigu.gulimall.order.service;

import com.atguigu.common.to.mq.SeckillOrderTO;
import com.atguigu.gulimall.order.vo.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.order.entity.OrderEntity;

import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 订单
 *
 * @author baixiaofei
 * @email 2053989588@qq.com
 * @date 2025-01-17 00:10:08
 */
public interface OrderService extends IService<OrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 给订单确认页返回需要的数据
     * @return
     */
    OrderConfirmVO confirmOrder() throws ExecutionException, InterruptedException;

    SubmitOrderResponseVO submitOrder(OrderSubmitVO vo);

    OrderEntity getOrderByOrderSn(String orderSn);

    void closeOrder(OrderEntity entity);

    /**
     * 根据订单号获取订单的支付信息
     * @param orderSn
     * @return
     */
    PayVO getOrderPay(String orderSn);

    /**
     * 查询当前登录用户的所有订单(分页查询)
     * @param params
     * @return
     */
    PageUtils queryPageWithItem(Map<String, Object> params);

    /**
     * 处理返回结果并封装到一个VO里面
     * @param vo
     * @return
     */
    String handlePayResult(PayAsyncVO vo);

    /**
     * 创建一个秒杀单
     * @param seckillOrder
     */
    void createSeckillOrder(SeckillOrderTO seckillOrder);
}

